<{include file="public_html/header.html"}>
<{include file="public_html/left_menu.html"}>
<style>
	.layui-table img{max-height: 100px;}
</style>
	<!-- content starts -->
	<blockquote class="layui-elem-quote"><{$action}></blockquote>

	<fieldset class="layui-elem-field">
  		<legend>按条件搜索</legend>
  		<div class="layui-field-box">
			<form class="layui-form layui-form-pane1" method="post" action="">
				<div class="layui-form-item">
					<div class="layui-inline">
			    		<select name="type" lay-verify="required" lay-filter="timu_type" id="timu_type">
							<option value="0">请选择题型</option>
							<option value="1" <{if 1 == $conditions.type|default:""}> selected <{/if}>>单选题</option>
							<option value="2" <{if 2 == $conditions.type|default:""}> selected <{/if}>>多选题</option>
							<option value="3" <{if 3 == $conditions.type|default:""}> selected <{/if}>>判断题</option>
							<option value="4" <{if 4 == $conditions.type|default:""}> selected <{/if}>>简答题</option>
							<option value="5" <{if 5 == $conditions.type|default:""}> selected <{/if}>>填空题</option>
							<option value="6" <{if 6 == $conditions.type|default:""}> selected <{/if}>>计算题</option>
							<option value="7" <{if 7 == $conditions.type|default:""}> selected <{/if}>>算式题</option>
							<option value="8" <{if 8 == $conditions.type|default:""}> selected <{/if}>>图形连线题</option>
							<option value="9" <{if 9 == $conditions.type|default:""}> selected <{/if}>>看图写答案</option>
							<option value="10" <{if 10 == $conditions.type|default:""}> selected <{/if}>>看图画星</option>
						</select>	
			    	</div>
			    	<div class="layui-inline">
			    		<input type="title" name="title" placeholder="题目内容" value="<{if !empty($conditions.title)}><{$conditions.title}><{/if}>" class="layui-input">
			    	</div>
			    	<div class="layui-inline">
			    		<button type="submit" class="layui-btn">搜索</button>
			    	</div>
		    	</div>
			</form>
  		</div>
	</fieldset>
	<form class="layui-form layui-form-pane1" method="post" delete_action="/topic/delete">
		<table class="layui-table" lay-even lay-skin="row">
		  	<thead>
			  	<tr>
				  	<th>ID</th>
				  	<th>题目类型</th>
				  	<th>题目内容</th>
				  	<th>操作</th>
			  	</tr>
		  	</thead>   
		  	<tbody>
		  	<{foreach from=$timu_list item=item}>
			  	<tr>
			  		<td class="center">
						<input type="checkbox" name="ids[]" value="<{$item['id']}>" title="<{$item['id']}>">
			  		</td>
			  		<td class="center">
			  			<{if $item['type'] == 1}>单选题
			  			<{elseif $item['type'] == 2}>多选题
			  			<{elseif $item['type'] == 3}>判断题
			  			<{elseif $item['type'] == 4}>简答题
			  			<{elseif $item['type'] == 5}>填空题
			  			<{elseif $item['type'] == 6}>计算题
			  			<{elseif $item['type'] == 7}>算式题
			  			<{elseif $item['type'] == 8}>图形连线题
			  			<{elseif $item['type'] == 9}>看图写答案
			  			<{elseif $item['type'] == 10}>看图画星
			  			<{/if}>
			  			
			  		</td>
			  		<td class="center"><{$item['title']}></td>
			  		<td class="center">
						<a class="layui-btn layui-btn-primary layui-btn-small delete_data" href="/topic/delete/<{$item['id']}>"><i class="layui-icon"></i></a>
						<a class="layui-btn layui-btn-primary layui-btn-small" href="/timu/save_main/<{$item['timu_id']}>" target="_blank">添加子题目</a>
					</td>
			  	</tr>
		  	<{/foreach}>
		  	<{if $timu_list|count eq 0}>
		  		<tr>
			  		<td class="center" style=" height:120px; text-align:center;line-height:120px;" colspan="8">
						赞无数据！
					</td>
			  	</tr>
		  	<{/if}>
		  	<tr>
				<td class="center" colspan="8">
					<input type="checkbox" lay-filter="checkbox_all" title="全选">
					<button id="delete" class="layui-btn layui-btn-primary layui-btn-small" style="margin-top:4px;"><i class="layui-icon"></i> 批量删除</button>
				</td>
			</tr>
	  		</tbody>
	  	</table>
  	</form>
  	<div class="layui-box layui-laypage layui-laypage-default">
		<{$pagination}>
	</div>      
<{include file="public_html/footer.html"}>